package com.webbei.Backstage.action;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.webbei.Backstage.service.BackstateSer;

public class CheckPwdAction {
			private String managerName;
			private String originalpwd;
			private BackstateSer bao;
			public String execute(){
				System.out.println(managerName+","+originalpwd);
				Map<String,String> map=new HashMap<String, String>();
				map.put("managersName", managerName.trim());
				map.put("managersPwd", originalpwd.trim());
				int i=bao.checkUserNamePwd(map);
				if(i==1){
					try {
						ServletActionContext.getResponse().getWriter().write("exist");
						ServletActionContext.getResponse().setContentType("text/html");
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}else{
					try {
						ServletActionContext.getResponse().getWriter().write("notexist");
						ServletActionContext.getResponse().setContentType("text/html");
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
				System.out.println("i:"+i);
				return null;
			}
			public String getManagerName() {
				return managerName;
			}
			public void setManagerName(String managerName) {
				this.managerName = managerName;
			}
			public String getOriginalpwd() {
				return originalpwd;
			}
			public void setOriginalpwd(String originalpwd) {
				this.originalpwd = originalpwd;
			}
			public BackstateSer getBao() {
				return bao;
			}
			public void setBao(BackstateSer bao) {
				this.bao = bao;
			}
			
}
